package xyf.p11.other.twopointer;

/**
 * ClassName: P0344_ReverseString
 * Description:
 * Author: xyf
 * Date: 9/9/22 10:20 AM
 * Version: 1.0
 **/
public class P0344_ReverseString
{
    public void reverseString(char[] s)
    {
        int start = 0;
        int end = s.length - 1;
        char tmp;
        while (start < end)
        {
            tmp = s[start];
            s[start] = s[end];
            s[end] = tmp;
            start++;
            end--;
        }
    }
}